<template>
  <el-popover
    placement="bottom"
    width="120"
    trigger="click"
    popper-class="publish-popover"
  >
    <div class="button-group">
      <div class="button" @click="jumpEditor">
        <img src="@/assets/image/navMenu/blog.png" />
        <div>写文章</div>
      </div>
      <div class="button" @click="jumpResource">
        <img src="@/assets/image/navMenu/upload.png" />
        <div>传资源</div>
      </div>
    </div>
    <div class="publish-button" slot="reference">
      <img
        src="@/assets/image/navMenu/publish-icon.png"
        class="publish-icon"
      />发布<img src="@/assets/image/navMenu/down.png" class="down" />
    </div>
  </el-popover>
</template>

<script>
export default {
  methods: {
    jumpResource() {
      this.$router.push("/uploadResource");
    },
    jumpEditor(){
      this.$router.push("/editor")
    }
  },
};
</script>

<style scoped>
.button-group {
  margin: 0;
  height: 50px;
  width: 150px;
  text-align: center;
}
.button {
  cursor: pointer;
  height: 50px;
  width: 75px;
  display: inline-block;
  text-align: center;
}
img {
  height: 30px;
  width: 30px;
}
.button > div {
  width: 75px;
  height: 20px;
  font-size: 12px;
  text-align: center;
}
.publish-button {
  box-sizing: border-box;
  padding-left: 4px;
  margin-left: 8px;
  cursor: pointer;
  display: inline-block;
  height: 32px;
  width: 96px;
  border-radius: 16px;
  background-color: #005a95;
  color: white;
  line-height: 32px;
  font-weight: bold;
  text-align: left;
}
.down {
  height: 12px;
  width: 12px;
  vertical-align: baseline;
  margin-left: 6px;
}
.publish-icon {
  height: 28px;
  width: 28px;
  margin-right: 2px;
  vertical-align: middle;
}
.publish-button:hover {
  background-color: #7dc5eb;
}
</style>

<style>
.el-popover.publish-popover {
  margin-top: 14px;
  padding-left: 0;
  padding-right: 0;
}
</style>
